/**
 * 转正设置接口
 */
import request from '@/utils/request';

/**
 * 获取转正规则列表
 * @param {*} params
 */
export function getRuleList() {
    return request('/api/regular/v1/probation/ruleconfigs/configer', {
        method: 'POST'
    });
}

/**
 * 删除转正规则
 * @param {*} configId
 */
export function deleteRule(configId) {
    return request(`/api/regular/v1/probation/ruleconfigs/actions/deleted/${configId}`, {
        method: 'DELETE'
    });
}

/**
 * 复制转正规则
 * @param {*} configId
 */
export function copyRule(configId) {
    return request(`/api/regular/v1/probation/ruleconfigs/actions/replica_config/${configId}`, {
        method: 'POST'
    });
}

/**
 * 新增修改转正规则
 * @param {*} params
 */
export function addRule(params) {
    return request('/api/regular/v1/probation/ruleconfigs/actions/saveorupdate_config', {
        method: 'POST',
        data: params
    });
}

/**
 * 获取转正规则详情
 * @param {*} configId
 */
export function getRule(configId) {
    return request(`/api/regular/v1/probation/ruleconfigs/configer/${configId}`, {
        method: 'GET'
    });
}

/**
 * 更新转正规则-能力评估表
 * @param {*} params
 */
export function updateEvaluation(params) {
    return request(`/api/regular/v1/probation/ruleconfigs/configer/${params.id}/ability_assess`, {
        method: 'PUT',
        data: params
    });
}

/**
 * 转正规则覆盖校验
 * @param {*} params
 */
export function checkRule(params) {
    return request('/api/regular/v1/probation/ruleconfigs/actions/save_check', {
        method: 'POST',
        data: params
    });
}

/**
 * 获取能力评估表列表
 * @param {*} params
 */
export function getAbilityEvaluation() {
    return request('/api/regular/v1/probation/ability_evaluation/list', {
        method: 'GET'
    });
}

/**
 * 删除能力评估表
 * @param {*} params
 */
export function delAbilityEvaluation(id) {
    return request(`/api/regular/v1/probation/ability_evaluation/actions/delete/${id}`, {
        method: 'DELETE'
    });
}

/**
 * 获取能力评估表详情
 * @param {*} params
 */
export function getAbilityEvaluationDetail(id) {
    return request(`/api/regular/v1/probation/ability_evaluation/detail/${id}`, {
        method: 'GET'
    });
}

/**
 * 新增修改能力评估表
 * @param {*} params
 */
export function saveAndUpdateAbilityEvaluation(params) {
    return request('/api/regular/v1/probation/ability_evaluation/actions/save_or_modify', {
        method: 'POST',
        data: params
    });
}

/**
 * 获取禁用的行政机构
 */
export function getExistCompanyCodes() {
    return request('/api/regular/v1/probation/ruleconfigs/filter_exists_company_code', {
        method: 'GET'
    });
}
